package com.community.itelligentcommunity.community.communityProperty.controller;

import com.community.itelligentcommunity.common.base.controller.GenericController;
import com.community.itelligentcommunity.common.base.service.GenericService;
import com.community.itelligentcommunity.community.communityProperty.entity.PatrolControlInf;
import com.community.itelligentcommunity.community.communityProperty.entity.QueryPatrolControl;
import com.community.itelligentcommunity.community.communityProperty.service.PatrolControlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/patrolControl")
public class PatrolControl extends GenericController<PatrolControlInf, QueryPatrolControl> {

    @Autowired
    private PatrolControlService pillControlService;

    @Override
    protected GenericService<PatrolControlInf, QueryPatrolControl> getService() {
        return pillControlService;
    }

    @Override
    public String updatePage(PatrolControlInf entity, Model model) throws Exception {

        entity = getService().get(entity);
        model.addAttribute("entity",entity);
        return "community/communityProperty/PatrolControl/update";
    }

    @Override
    public String addPage() throws Exception {
        return "community/communityProperty/PatrolControl/add";
    }
}
